﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace iCloudPortal
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private ToolbarWindow ToolbarWindow;

        public MainWindow()
        {
            InitializeComponent();
            ToolbarWindow = new ToolbarWindow(this);
            ToolbarWindow.Show();
        }

        public void RefreshBrowser()
        {
            try
            {
                Browser.Refresh();
            }
            catch
            {
                MessageBox.Show(this, "Refresh Fails", this.Title, MessageBoxButton.OK, MessageBoxImage.Warning, MessageBoxResult.OK);
            }
        }

        public void Browse(string url)
        {
            Browser.Navigate(new Uri(url));
        }

        public void BrowseHome()
        {
            Browse("http://os.icloud.com");
        }
    }
}
